package com.sjh.lib_app.adapter

import android.os.Bundle
import android.widget.LinearLayout
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.sjh.lib_app.baseui.BaseActivity
import com.sjh.lib_app.R
import com.sjh.lib_app.databinding.AppItemNullBinding

/**
 *  这个Activity只是为了初始化Adapter创建的
 * @author : SunJH
 * @data : 2020/7/23
 */
class AdapterInitActivity : BaseActivity(){
    val mAdapter by  lazy {
        object : BaseAdapter<String, AppItemNullBinding>(
            R.layout.app_item_null,
            arrayListOf()){
        }
    }
    override fun onCreateRootView(): Any? {
        val layout = LinearLayout(this)
        val list = RecyclerView(this)
        list.apply {
            adapter = mAdapter
            layoutManager = LinearLayoutManager(this@AdapterInitActivity)
        }
        layout.addView(list)
        return layout
    }

    override fun onInitView(savedInstanceState: Bundle?) {}

    override fun initListener() {}

    override fun initData() {}

}